package com.easylinkin.linkappapi.quality.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.easylinkin.linkappapi.quality.dto.QualityQuestionInfoDto;
import com.easylinkin.linkappapi.quality.dto.QualityQuestionPhotoAlbumDTO;
import com.easylinkin.linkappapi.quality.dto.QualityQuestionPhotoAlbumQueryDTO;
import com.easylinkin.linkappapi.quality.dto.QualityQuestionStatisticsQueryDTO;
import com.easylinkin.linkappapi.quality.dto.QualityScreenDTO;
import com.easylinkin.linkappapi.quality.entity.QualityQuestionInfo;
import com.easylinkin.linkappapi.quality.entity.vo.QualityQuestionInfoVo;
import java.io.Serializable;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.easylinkin.linkappapi.quality.entity.vo.QualityScreenPageVo;
import site.morn.rest.RestMessage;

/**
 * QualityQuestionInfo表服务接口
 *
 * @author zhengwen
 * @date 2022/08/16
 */
public interface QualityQuestionInfoService extends IService<QualityQuestionInfo> {

    /**
     * 新增
     *
     * @param appQualityQuestionInfo 实体对象
     * @return 操作结果
     */
    boolean saveOne(QualityQuestionInfo appQualityQuestionInfo);

    /**
     * 修改单条
     *
     * @param appQualityQuestionInfo 实体对象
     * @return 修改结果
     */
    boolean updateOne(QualityQuestionInfo appQualityQuestionInfo);

    /**
     * 查询分页
     *
     * @param page        分页对象
     * @param appQualityQuestionInfo 分页参数对象
     * @return 查询分页结果
     */
    IPage<QualityQuestionInfo> selectPage(Page page, QualityQuestionInfo appQualityQuestionInfo);


    /**
     * 获取单条
     *
     * @param id 主键id
     * @return 查询结果
     */
    QualityQuestionInfo getOneById(Serializable id);

    /**
     * 根据id批量删除
     *
     * @param idList 主键列表
     * @return 删除结果
     */
    boolean deleteByIds(List<Long> idList);

    /**
     * 导出表格
     *
     * @param appQualityQuestionInfo 过滤条件实体对象
     * @param request     请求
     * @param response    响应
     */
    void export(QualityQuestionInfo appQualityQuestionInfo, HttpServletRequest request, HttpServletResponse response);

    /**
     * @Description: 质量问题分类统计
     * @author kan yuanfeng
     * @date 2020/11/04 11:42
     */
    List<QualityScreenDTO> getByProblemType(QualityScreenDTO qualityScreenDTO);

    /**
     * @Description: 整改率统计
     * @author kan yuanfeng
     * @date 2020/11/04 11:42
     */
    List<String> dealRecord(List<Long> questionInfoIds);
    /**
     * 问题保存
     *
     * @param qualityQuestionInfoVo 实体对象
     * @return 新增结果
     */
    RestMessage saveQuestion(QualityQuestionInfoVo qualityQuestionInfoVo);

    /**
     * @Description: 统计概览
     * @author kan yuanfeng
     * @date 2020/11/04 11:42
     */
    List<Integer> overview();

    /**
     * 查询问题列表
     * @param page page对象
     * @param questionInfoVo 问题信息vo
     * @return ipage
     */
    IPage<QualityQuestionInfoDto> selectDtoPage(Page page, QualityQuestionInfoVo questionInfoVo);

    /**
     * @Description: 分包单位统计
     * @author kan yuanfeng
     * @date 2020/11/04 11:42
     */
    List<QualityScreenDTO> getBySubOrg();

    /**
     * @Description: 查询一个月内的数据
     * @author kan yuanfeng
     * @date 2020/11/04 11:42
     */
    List<QualityScreenDTO> getByMonth();

    /**
     * 根据id查询单条数据dto信息
     * @param id 主键
     * @return 统一出参
     */
    RestMessage selectDtoOne(Long id);

    /**
     * 根据id查询单条数据dto信息
     * @param id 主键
     * @return 统一出参
     */
    RestMessage selectDtoOneFromEnterprise(Long id);
    /**
     * 获取tab头上的数量
     * @param questionInfoVo 问题入参
     * @return 统一出参
     */
    RestMessage getTabCountNum(QualityQuestionInfoVo questionInfoVo);

    IPage<QualityQuestionPhotoAlbumDTO> selectPhotoAlbumByPage(Page page,QualityQuestionPhotoAlbumQueryDTO queryDTO);

    int photoAlbumCount(QualityQuestionPhotoAlbumQueryDTO queryDTO);

    String exportPhotoAlbum(QualityQuestionPhotoAlbumQueryDTO dto);

    RestMessage countQualityQuestionByType(Page page, QualityQuestionStatisticsQueryDTO queryDTO);

    void exportCountQualityQuestionByType(QualityQuestionStatisticsQueryDTO queryDTO, HttpServletRequest request, HttpServletResponse response);

  boolean modifyRectifyUser(QualityQuestionInfo appQualityQuestionInfo);

  boolean modifyCheckUser(QualityQuestionInfo appQualityQuestionInfo);

    /**
     * 分包单位排名
     *
     * @param qualityScreenPageVo 条件vo
     * @return 统一出参
     */
    RestMessage laborQuestionRanking(QualityScreenPageVo qualityScreenPageVo);

    /**
     * 查询问题列表
     * @param page
     * @param customQueryParams
     * @return
     */
    IPage<QualityQuestionInfoDto> selectDtoPageFromEnterprise(Page page, QualityQuestionInfoVo customQueryParams);
}

